##
# Units for the WTFOMG RTS
##

import Class;
import Weapon;
import WtfRts;
import Orders;
from scripts import *;

class Unit:
	def __init__(self):
		self.materialCost = 0;
		self.monetaryCost = 0;
		
		self.movementClass = 0;
		self.armourClass = 0;
		self.orders = Orders.Manager.GetInst().defaultOrders;
		
class Vehicle(WtfRts.Vehicle):
	def __init__(self, opts, rGfx):
		WtfRts.Vehicle.__init__(self, opts, rGfx);
		

#### Western Units ####

# Based on Abrahms tank
class UsaTank(Unit, Vehicle):
	name = "Main Battle Tank";
	description = "";
	
	def __init__(self):
		Unit.__init__(self);
		Vehicle.__init__(self, WtfRts.VehicleCreationOptions(), XModel("media/models/Vehicles/Abrams.x"));
		
		self.constructionRate = 60;
		self.maxHealth = 1000;
		self.position = Vector(0, 10, 0);
				

class Humvee(Unit):
	name = "Humvee";
	description = "Fast infantry transport with light armour. Loaded infantry can fire out of windows.";
	
	def __init__(self):
		Unit.__init__(self);
		
		self.maxHealth = 400;
		


#### Eastern Units ####


class Apc(Unit, Vehicle):
	name = "APC";
	description = "Armoured Personnel Carrier equipped with a 12mm cannon. Fast and versatile. Effective against infantry.";
	
	def __init__(self):
		Unit.__init__(self);
		Vehicle.__init__(self, WtfRts.VehicleCreationOptions(), XModel("media/models/Vehicles/ApcChassis.x"));
		
		self.maxHealth = 1000;
		self.position = Vector(0, 10, 0);


#### Common & Supply Chain Units ####


class SupplyUnit(Unit):
	def __init__(self):
		Unit.__init__(self);
		
		self.supplyCapacity = 0;
		


# Construction units are required to build base structures, and can also
# collect supplies, albeit at a slower rate than dedicated supply units.
class ConstructionUnit(SupplyUnit):
	def __init__(self):
		SupplyUnit.__init__(self);
		
		# Amount of material processed each second
		self.constructionRate = 0;


# Basic worker unit - on foot, slow moving, slow building
# and vulnerable.
class Worker(ConstructionUnit):
	def __init__(self):
		ConstructionUnit.__init__(self);
		
		self.baseHealth = 40;
		self.supplyCapacity = 10;
		self.constructionRate = 40;
		

# Engineers travel by truck. Fast moving, slow build speed
# and still vulnerable.
class Engineer(ConstructionUnit, Vehicle):
	def __init__(self):
		ConstructionUnit.__init__(self);
		Vehicle.__init__(self, WtfRts.VehicleCreationOptions(), XModel("media/models/Vehicles/Engineer.x"));
		
		self.constructionRate = 60;
		self.maxHealth = 100;
		self.position = Vector(0, 10, 0);


# Dozers are the fastest builders, but slow moving. They
# are lightly armoured.
class Dozer(ConstructionUnit, Vehicle):
	def __init__(self):
		ConstructionUnit.__init__(self);
		Vehicle.__init__(self, WtfRts.VehicleCreationOptions(), XModel("media/models/Vehicles/Dozer.x"));
		
		self.constructionRate = 100;


class Chinook(SupplyUnit):
	def __init__(self):
		Unit.__init__(self);
		
		self.baseHealth = 400;
		
